<?php include(TPL_PATH . '/admin/inc_header.php'); ?>
<?php include(TPL_PATH . '/admin/inc_top.php'); ?>

<script type="text/javascript">
function del(path) {
	if (confirm('删除不可还原,确认删除?')) {
		window.location.href = location.href + '&del=' + path;
	}
}
</script>

<table class="table table-bordered" width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td colspan="3">
			<ul class="breadcrumb" style="margin:0px;">
				<?php $arrTemp = explode('/', $strPath); array_pop($arrTemp); $intLen = count($arrTemp); $strPathTemp = '/'; $intTemp = 0; foreach ($arrTemp as $strTemp) { ?>
					<?php $intTemp ++; if ($intTemp < $intLen) { ?>
					<li><a href="<?php p(HTTP_URL) ?>/index.php?m=admin&c=file&path=<?php p($strPathTemp . $strTemp . (empty($strTemp) ? '' : '/')) ?>"><?php p(empty($strTemp) ? '根' : $strTemp) ?></a> <span class="divider">/</span></li>
					<?php } else { ?>
					<li class="active"><?php p(empty($strTemp) ? '根' : $strTemp) ?></li>
					<?php } ?>
				<?php $intTemp > 1 && $strPathTemp .= $strTemp . '/'; } ?>
            </ul>
		</td>
	</tr>
	<?php foreach ($arrListDir as $strTemp) { ?>
	<tr>
		<td colspan="3"><i class="icon-folder-close"></i> <a href="<?php p(HTTP_URL) ?>/index.php?m=admin&c=file&path=<?php p($strPath . $strTemp) ?>"><?php p($strTemp) ?></a></td>
	</tr>
	<?php } ?>
	<?php foreach ($arrListFile as $strTemp) { $strPathTemp = str_replace(UPLOADS_PATH, '', $strRealPath); ?>
	<tr>
		<td><i class="icon-file"></i> <a target="_blank" href="<?php p(HTTP_URL . (str_replace(ROOT_PATH, '', $strRealPath)) . $strTemp) ?>"><?php p($strTemp) ?></a></td>
		<td style="width:305px;">
			<form method="post" action="" class="form-search" style="margin-bottom:0px;">
				<div class="input-append">
					<input type="hidden" name="path_" value="<?php p($strPathTemp) ?>" />
					<input type="hidden" name="path" value="<?php p($strPathTemp . $strTemp) ?>" />
                    <input type="text" name="new_name" value="" class="search-query" />
                    <button type="submit" class="btn">重命名</button>
                </div>
			</form>
		</td>
		<td style="width:55px;"><a class="btn btn-danger" href="javascript:del('<?php p($strPathTemp . $strTemp) ?>');">删除</a></td>
	</tr>
	<?php } ?>
</table>

<?php include(TPL_PATH . '/admin/inc_bottom.php'); ?>
<?php include(TPL_PATH . '/admin/inc_footer.php'); ?>